package de.kardass.jsmatep.in.reader;

import de.kardass.jsmatep.schema.jSmaTePImportConfig.FieldType;
import de.kardass.jsmatep.schema.jSmaTePImportConfig.RecordImportConfigType;

public class CsvRecordReader extends AbstractRecordReader {
	
	private CsvBufferedRecordSplitted recordSplitter = new CsvBufferedRecordSplitted();
	
	public CsvRecordReader(RecordImportConfigType importConfig) {
		super(importConfig);
		
	}

	public String readField(FieldType fieldConfig, String theRecord) {
		return recordSplitter.readField(theRecord, getImportConfig().getType().getCsv().getDelimiter(), fieldConfig.getPosition());
	}

}
